import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入全局样式
import './assets/css/logbal.css'
// 引入enement
import './plugins/element'

// 全局变量
import variable from './Global'
Vue.use(variable)

// 全局组件
import MyList from './components/MyList.vue'
Vue.component(MyList.name, MyList)

// 轮播图全局组件
import CarouselMap from './components/CarouselMap.vue'
Vue.component(CarouselMap.name, CarouselMap)

// 登录全局组件
import Login from './views/Login.vue'
Vue.component(Login.name, Login)

// 注册全局组件
import Register from './views/Register.vue'
Vue.component(Register.name, Register)

//全局过滤器
Vue.filter('time', function (val) {
    //将时间转换为对象
    //获取到年月日时分秒，然后根据需求拼杰字符串
    var date = new Date(val)
    var Y = date.getFullYear();
    var M = date.getMonth();
    var D = date.getDate();
    var h = date.getHours();
    var f = date.getMinutes() + '';
    f = f.padStart(2, 0)
    var m = date.getSeconds() + '';
    m = m.padStart(2, 0)
    return `${Y}/${M}-${D} ${h}:${f}:${m}`
    //padStart(目标位数,"填充的字符") 不够目标位数  用填充的字符来填充

})

Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')